import java.util.Stack;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 涛
 * Date: 2023-10-13
 * Time: 10:24
 */
public class Sort {
    public static void quickSortNor(int[] array) {
        int start = 0;
        int end = array.length - 1;
        Stack<Integer> stack = new Stack<>();
        int pivot = partitionHoare(array, start, end);

    }


    public static void quickSort(int[] array) {
        //快速排序

    }
    public static void bubbleSort(int[] array) {
        //冒泡排序
        boolean flag = false;
        for(int i = 0; i < array.length; i++) {
            for (int j = 0; j < array.length - 1 - i; j++) {
                if(array[j] > array[j + 1]) {
                    swap(array, j, j + 1);
                    flag = true;
                }
            }
            if(!flag) {
                break;
            }
        }
    }
    public static void swap(int[] array, int i, int j) {
        int tmp = array[i];
        array[i] = array[j];
        array[j] = tmp;
    }
}
